﻿using System;
using ApprovalTests;
using GaDotNet.Common.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ApprovalUtilities.Utilities;

namespace SmallBasicFun.Tests.Tracking
{
	[TestClass]
	public class GoogleAnalyticsTest
	{
		[TestMethod]
		public void TestSend()
		{
			TrackingRequest.GetRandom = () => new Random(0);
			TrackingRequest.GetDate = () => new DateTime(2001,01,01);
			var track = new GoogleAnalyticsTrack();
	    Approvals.Verify(track.GetTrackingRequest().TrackingGifURL.Replace("&","\r\n&"));
		}

		[TestMethod]
		public void TestDomainHash()
		{
			var domains = new[]{"www.tkp.net"};
			Approvals.VerifyAll("DomainHashes", domains, d => "{0} => {1}".FormatWith(d, TrackingRequest.GetDomainHashFor(d)));
		
		}
	}
}
